#!/bin/bash
# The logic to start up your application should be put in this
# script. The application will work only if it binds to
# $OPENSHIFT_DIY_IP:8080

# Compute Java 8 Home
if [ -d /etc/alternatives/java_sdk_1.8.0 ]; then
    export JAVA_HOME=/etc/alternatives/java_sdk_1.8.0
else
    export JAVA_HOME=$OPENSHIFT_VERTX_DIR/java
fi
export PATH=$JAVA_HOME/bin:$PATH

export LOG=$OPENSHIFT_LOG_DIR/out.log

nohup java -Dhttp.port=$OPENSHIFT_DIY_PORT -Dhttp.address=$OPENSHIFT_DIY_IP -jar $OPENSHIFT_REPO_DIR/application/*-fat.jar > $LOG 2>&1 &

echo $! > $OPENSHIFT_REPO_DIR/RUNNING_PID
